package edu.zju.udms.dnavigator.entities.mongodb;

import edu.zju.udms.dnavigator.core.entity.AttributeType;
import edu.zju.udms.dnavigator.core.entity.AttributeTypeEnum;
import edu.zju.udms.dnavigator.core.entity.Entity;
import edu.zju.udms.dnavigator.core.entity.GeneralType;
import static edu.zju.udms.dnavigator.entities.mongodb.MongoDBExtractor.SOURCE;

public class MongoDBCollection extends Entity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1398730632834586824L;

	@AttributeType(AttributeTypeEnum.Key)
	public String hostName;
	
	@AttributeType(AttributeTypeEnum.Normal)
	public String databaseId;
	
	@AttributeType(AttributeTypeEnum.Normal)
	public long objects;
	
	@AttributeType(AttributeTypeEnum.Normal)
	public String dataSize;
	
	public MongoDBCollection(){}
	
	public MongoDBCollection(String hostName,String originName,String databaseId,long objects,String dataSize){
		super(null, null, GeneralType.Table,SOURCE, 0,0, null,null,null);
		this.hostName=hostName;
		this.objects=objects;
		this.dataSize=dataSize;
		this.databaseId=databaseId;
		String[] names = originName.split("\\.");
		setName(names[1]);
		setQualifiedName(names[0]+":"+names[1]);
		setBussinessName(names[1]);
	}

	public String getHostName() {
		return hostName;
	}

	public void setHostName(String hostName) {
		this.hostName = hostName;
	}

	public String getDatabaseId() {
		return databaseId;
	}

	public void setDatabaseId(String databaseId) {
		this.databaseId = databaseId;
	}

	public long getObjects() {
		return objects;
	}

	public void setObjects(long objects) {
		this.objects = objects;
	}

	public String getDataSize() {
		return dataSize;
	}

	public void setDataSize(String dataSize) {
		this.dataSize = dataSize;
	}
	
}
